#include <iostream>
#include <iomanip>
#include <sstream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    stringstream ss;
    ss  << hex << n;
    string s;
    ss >>s;
    cout << setw(8) << setfill('0') << s << endl;
    unsigned char * p = (unsigned char *)(&n);
    for(int i = 0; i < 3; i++)
    { 
       short t= *(p+i);
       cout << setw(2) <<setfill('0') <<hex<<t<<" ";
    }
    cout << setw(2) <<setfill('0') <<hex<<short(*(p+3));
}